
 /**
 * QueryAction.java.java.
 * User: BrianChen Date: 2012-7-4 下午05:51:09
 *
 * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
 * All rights reserved.
 */
package com.collapsar.snail.user.action;

import com.collapsar.core.action.BaseStrutsAction;
import com.collapsar.core.orm.page.Page;
import com.collapsar.core.security.model.User;
import com.collapsar.core.security.service.IUserManager;
import com.collapsar.core.util.GlobalConfig;

/**
 * <pre>
 * REVISIONS: 
 * Version 	Date 		Author 			Description
 * ------------------------------------------------------------------- 
 * 1.0 		2012-7-4 	BrianChen 	1. Created this class. 
 * </pre>
 * 
 * @author BrianChen
 * @date 2012-7-4 下午05:51:09
 * @version 1.0
 * @see
 * 
 */
@SuppressWarnings("serial")
public class QueryListAction extends BaseStrutsAction{
	private IUserManager userManager = null;
	private Page<User> userPage = null;
	
	
	
	@Override
	public String execute() throws Exception {
		String pagerOffsetStr = this.request.getParameter("pager.offset");
		logger.info("###pagerOffset="+pagerOffsetStr);	
		if(pagerOffsetStr == null){
			pagerOffsetStr = "0";
		}
		int pagerOffset = Integer.parseInt(pagerOffsetStr);
		this.userPage = this.userManager.queryAllUsers(pagerOffset, GlobalConfig.getPageSize());
		if(this.userPage == null){
			logger.info("###records is null");
		}
		return "user_manage_list";
	}

	
	
	
	public IUserManager getUserManager() {
		return userManager;
	}

	public void setUserManager(IUserManager userManager) {
		this.userManager = userManager;
	}

	public Page<User> getUserPage() {
		return userPage;
	}

	public void setUserPage(Page<User> userPage) {
		this.userPage = userPage;
	}	
	

}

